const user = require("./user.js")

// 集合对象.insertMany( 参数1, 参数2 )
// 参数1：对象或数组，表示要插入的数据
// 参数2：回调函数，表示插入完成后要执行的功能
    // 参数：报错信息，为null时，表示插入成功，为对象时，表示插入失败

user.insertMany([{
    username: "李四",
    password: "abcdefg",
    isVIP: true,
    age:17,
    hobby:["篮球","rap","背诗"]
},{
    username: "王二",
    password: "admin123",
    isVIP: true,
    age:30,
    hobby:["篮球","烫头","背诗"]
},{
    username: "赵五",
    password: "QWERadmin",
    isVIP: false,
    age:25,
    hobby:["篮球","编程","抽烟"]
},{
    username: "大张六",
    password: "QWERTYUIO",
    isVIP: false,
    age:23,
    hobby:["唱歌","编程","喝酒"]
},{
    username: "张七",
    password: "123TYUIO",
    isVIP: true,
    age:27,
    hobby:["唱歌","睡觉","喝酒"]
}], (err)=>{
    if(!err){
        console.log("插入成功");
    }
})
